<?php
$this->widget('ext.pagetitle.PageTitle',array(
	'parts'=>array($model->name),
));

$this->breadcrumbs=array(
	CHtml::encode($model->name),
);
?>

<div class="contest-view">

	<div class="top">
		<h1><?php echo CHtml::encode($model->name); ?></h1>
		<p class="description"><?php echo CHtml::encode($model->description); ?></p>

	</div>

	<?php if ($model->prize !== null): ?>
		<div class="prize well clearfix">
			<div class="image float-left">
				<?php $model->prize->renderImage(IMAGE_VERSION_SMALL,$model->prize->name); ?>
			</div>
			<div class="details float-left">
				<h3><?php echo Yii::t('frontend','Submit an entry and win a :name',array(':name'=>$model->prize->name)); ?></h3>
				<p class="description"><?php echo CHtml::encode($model->prize->description); ?></p>
			</div>
			<div class="submit-entry">
				<?php $this->renderPartial('/contest/_submitButton',array('model'=>$model,'buttonCssClass'=>'large')); ?>
			</div>
		</div>
	<?php endif; ?>

	<a name="entries"></a>
	<div class="entries clearfix">
		<?php $this->widget('BootstrapListView', array(
			'dataProvider'=>$entries,
			'itemView'=>'/entry/_view',
			'template'=>'{sorter} {items} {pager}',
			'emptyText'=>Yii::t('frontend','No entries have been submitted for this competition.'),
			'afterAjaxUpdate'=>"js:function(id,data) {
				jQuery('.twipsify').bootstraptwipsy();
			}",
			'sortableAttributes'=>array(
				'votes',
				'created',
			),
		)); ?>
	</div>

	<div class="like">
		<fb:like href="<?php echo Yii::app()->createAbsoluteUrl('view',array('id'=>$model->id)); ?>" send="true" layout="standard" width="450" show_faces="false" action="recommend" font="arial"></fb:like>
	</div>

</div>
